package com.xmall.pethouse_api.controller;


import com.xmall.pethouse_api.pojo.Result;
import com.xmall.pethouse_api.pojo.entity.ServiceType;
import com.xmall.pethouse_api.service.ServiceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/serviceType")
@Validated
public class ServiceTypeController {

    @Autowired
    private ServiceTypeService serviceTypeService;

    @GetMapping( "/list")
    public Result<List<ServiceType>> SelectAllList(){
        List<ServiceType> serviceTypeList = serviceTypeService.SelectAllList();
        return Result.success(serviceTypeList);
    }
}
